package com.zsh.wanandroid.ui.adapter;

import android.support.annotation.LayoutRes;
import android.support.annotation.Nullable;
import android.view.View;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.zsh.wanandroid.R;
import com.zsh.wanandroid.bean.KnowledgeChildren;
import com.zsh.wanandroid.bean.KnowledgeTree;
import com.zsh.wanandroid.utils.UIUtils;

import java.util.List;

/**
 * @author zsh
 * @date 2020/3/19.
 * 功能：
 */
public class SystemAdapter extends BaseQuickAdapter<KnowledgeTree<KnowledgeChildren>, BaseViewHolder> {

    public SystemAdapter(@LayoutRes int layoutResId, @Nullable List<KnowledgeTree<KnowledgeChildren>> data) {
        super(layoutResId, data);
    }

    public SystemAdapter(@LayoutRes int layoutResId) {
        super(layoutResId);
    }

    public SystemAdapter(@Nullable List<KnowledgeTree<KnowledgeChildren>> data) {
        super(data);
    }

    @Override
    protected void convert(BaseViewHolder helper, KnowledgeTree<KnowledgeChildren> item) {
        helper.setText(R.id.tvTitle, item.getName());
        String content = "";
        List<KnowledgeChildren> children = item.getChildren();
        for (KnowledgeChildren k : children) {
            content += k.getName()+"   ";
        }
        helper.setText(R.id.tvContent, content);
    }
}
